<!DOCTYPE html>
<html>
<head>
    <title>推荐客户</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <link rel="stylesheet" href="${s.base}/mobile/base/css/weui.min.css">
    <link rel="stylesheet" href="${s.base}/mobile/base/css/jquery-weui.css">
    <link rel="stylesheet" href="${s.base}/mobile/base/css/base.css?123456">
    <link rel="stylesheet" href="${s.base}/mobile/base/css/component.css?123456">
    <link rel="stylesheet" type="text/css" href="${s.base}/mobile/base/lib/DateSelector/DateSelector.css?rev=@@hash"/>
    <style type="text/css">
        body, html {
            background: #ffffff;
        }
        .weui-cell {
            padding: 20px 30px;
        }
        .weui-cells{
            line-height: 2;
            font-size: 28px;
        }
        .toolbar .toolbar-inner{
            height: 3.4rem;
        }
        .toolbar .title{
            font-size: 34px;
            line-height: 3.4rem;
        }
        .toolbar .picker-button{
            height: 3.4rem;
            line-height: 3.4rem;
            font-size: 28px;
        }
        .weui-btn{line-height: 90px; height: 90px; font-size: 28px; width: 80%;}
        button.weui-btn, input.weui-btn{width: 80%;}
        .date-selector-container{height: 350px;}
        .date-selector-content .date-selector{height: 270px;}
        .date-selector-tab-box{height: 47px;line-height: 47px; color: #999999; }
        .date-selector-btn-box{height: 80px; line-height: 80px;}
        .date-selector-btn-box .date-selector-btn{color: #000000;}
        .date-selector-tab-box .date-selector-tab-active{color: #666666;}
        .date-selector-content{top:80px;}
        .date-selector-content li {
            font-size: 28px;
        }
    </style>
</head>
<body>
<div id="xyg-comp-page">
<div class="xyg-comp-form">
    <div class="backgroud1">
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                客户姓名
            </div>
            <div class="xyg-comp-form-item-content">
                <input type="text" id="name" placeholder="请先输入客户姓名"/>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                客户性别
            </div>
            <div class="xyg-comp-form-item-icon" >
                <input type="text" id="sex" placeholder="请先选择客户性别"/> <span><svg class="icon" aria-hidden="true">
                  <use xlink:href="#iconxiangyou"></use>
                 </svg> </span>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                电话号码
            </div>
            <div class="xyg-comp-form-item-content">
                <input type="text" id="phone" placeholder="请先输入电话号码"/>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                推荐楼盘
            </div>
            <input type="hidden" name="itemId" id="itemId"/>
            <div class="xyg-comp-form-item-icon" id="cityBtn">
                <span id="itemName">请先选择楼盘</span>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                客户所在地
            </div>
            <div class="xyg-comp-form-item-content">
                <input type="text" id="setUpBusiness" placeholder="请输入客户所在城市（省+市）"/>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item-one  margT20">
            <div class="xyg-comp-form-item-title">
                看房日期
            </div>
            <div class="xyg-comp-form-item-content">
                <input  type="text" id='datetime-picker' value="" placeholder="请选择看房日期">
            </div>
            <div class="clearBoth"></div>
        </div>
        <!--<div class="xyg-comp-form-item-one  margT20">
            <div class="xyg-comp-form-item-title">
                看房日期
            </div>
            <div class="xyg-comp-form-item-content">
                <input type="text" id="useTime" readonly placeholder="请选择看房日期" />
                <div id="targetContainers"></div>
            </div>
            <div class="clearBoth"></div>
        </div>-->
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                客户来源
            </div>
            <div class="xyg-comp-form-item-icon" >
                <input type="text" id="customerSource" placeholder="请先选择客户来源"/> <span><svg class="icon" aria-hidden="true">
                  <use xlink:href="#iconxiangyou"></use>
                 </svg> </span>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item-one">
            <div class="xyg-comp-form-item-title">
                备注(选填)
            </div>
            <div class="xyg-comp-form-item-content">
                <input type="text" id="remarks" placeholder="请先输入备注"/>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="xyg-comp-form-item">
            <div class="xyg-comp-form-item-textarea-content">
                <textarea class="font-base4-size" id="moreRemarks" placeholder="请输入补充说明（选填）"></textarea>
            </div>
        </div>
    </div>
    <div class="margT60 width-b-80">
        <div onclick="submit()" class="xyg-btn-two backgroud4 color2" >确认推荐</div>
    </div>

</div>

<!--底部菜单开始-->
<div style="width:100%; height:128px;"></div>
<div class="xyg-comp-bottom3">
    <div class="xyg-comp-bottom-item">
        <a href="javascript:goFistPage('${memberId}')">
            <img src="${s.base}/mobile/base/images/icon_menu_1.png"/>
            <div class="xyg-comp-bottom-item-text ">首页</div>
        </a>
    </div>
    <div class="xyg-comp-bottom-item">
        <a href="javascript:goAllCustomerEditPage('${memberId}')">
            <img src="${s.base}/mobile/base/images/icon_menu_2_a.png"/>
            <div class="xyg-comp-bottom-item-text select-text">推荐</div>
        </a>
    </div>
    <div class="xyg-comp-bottom-item">
        <a href="javascript:goMyPage('${memberId}')">
            <img src="${s.base}/mobile/base/images/icon_menu_3.png"/>
            <div class="xyg-comp-bottom-item-text">我的</div>
        </a>
    </div>
    <div class="clearBoth"></div>
</div>
</div>
<!--底部菜单结束-->
<!--城市选开始择-->
<div id="citySelect" style="display:none" class="xyg-comp-select">
    <div id="showLetter" class="showLetter"><span>A</span></div>
    <div class="letter">
        <ul>
            <li><a href="javascript:;">热门</a></li>
            <li><a href="javascript:;">历史</a></li>
        </ul>
    </div>
    <!--城市列表-->
    <div class="container-city">
        <div class="city">

        </div>
    </div>
</div>
<!--城市选择结束-->
</body>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script src="${s.base}/mobile/base/js/jquery-2.1.4.js"></script>
<script src="${s.base}/mobile/base/js/jquery-weui.js"></script>
<script src="${s.base}/mobile/base/js/swiper.js"></script>
<script src="${s.base}/mobile/base/fonts/iconfont.js"></script>
<script src="${s.base}/mobile/base/js/component.js"></script>
<script src="${s.base}/mobile/base/js/base.js?123456789000"></script>
<script src="${s.base}/mobile/base/lib/DateSelector/DateSelector.js"></script>
<script src="${s.base}/mobile/base/js/zepto.js"></script>
<script src="${s.base}/mobile/base/js/city.js"></script>

<!--js分享代码开始-->
<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
<script src="${s.base}/mobile/base/js/share.js"></script>


<script type="text/javascript">
    initXygDpi();
    var phone='${webMember.phone}';
    if(phone==null||phone==""){
        $.alert("请先完善信息！",function () {
            window.location.href="/weChat/myEdit?memberId="+memberId;
        });
    }
    var memberId='${memberId}';
    $("#datetime-picker").datetimePicker();
    /*new DateSelector({
        input: 'useTime',//点击触发插件的input框的id
        container: 'targetContainers',//插件插入的容器id
        type: 1,
        param: [1, 1, 1, 1, 1],
        beginTime: [${currentDate?string('yyyy')}, ${currentDate?string('MM')}, ${currentDate?string('dd')}, ${currentDate?string('HH')}, ${currentDate?string('mm')}],//如空数组默认设置成1970年1月1日0时0分开始，如需要设置开始时间点，数组的值对应param参数的对应值。
        endTime: [2027, 5, 7, 12, 2],//如空数组默认设置成次年12月31日23时59分结束，如需要设置结束时间点，数组的值对应param参数的对应值。
        recentTime: [${currentDate?string('yyyy')}, ${currentDate?string('MM')}, (${currentDate?string('dd')})*1+1, ${currentDate?string('HH')}, ${currentDate?string('mm')}],
        success: function (arr, arr2) {
            $("#useTime").val(arr2[0]+"-"+arr2[1]+"-"+arr2[2]+" "+arr2[3]+":"+arr2[4])
        }//回调
    });*/

    $(document).ready(function(e) {
        initDate();
    });

    function initDate() {
        $.get('/weChat/cityItemSelect', {}, function (res) {
            if (res.code == 0) {
                initSelectData("citySelect","cacheItem",res.data.hotCitySelect,res.data.citySelect,rightLetter,"热门城市",function(id,name){
                    $("#xyg-comp-page").show();
                    $("#citySelect").hide();
                    // alert(id+";"+name);
                    // 切换城市
                    // goFistPage(memberId, id);
                    $("#itemId").val(id);
                    $("#itemName").html(name);
                });
            }
        });

        $("#cityBtn").bind("click",function(){
            $("#xyg-comp-page").hide();
            $("#citySelect").show();
        });

        $("#sex").select({
            title: "选择性别",
            items:[{
                title: "男",
                value: 1
            },{
                title: "女",
                value: 2
            }]
        });

        $("#customerSource").select({
            title: "选择客户来源",
            items:[{
                title: "公职人员",
                value: 1
            },{
                title: "私企老板",
                value: 2
            },{
                title: "企业白领",
                value: 3
            },{
                title: "自由职业",
                value: 4
            }]
        });
    }

    function submit() {
        var itemId = $("#itemId").val();
        var name = $("#name").val();
        if(name == null || name == "") {
            $.toast("请填写客户信息", "text");
            return false;
        }
        var sex = $("#sex").attr("data-values");
        if(sex == null || sex == "") {
            $.toast("请选择性别", "text");
            return false;
        }
        var phone = $("#phone").val();
        if(phone == null || phone == "") {
            $.toast("请输入手机号", "text");
            return false;
        }
        var setUpBusiness = $("#setUpBusiness").val();
        if(setUpBusiness == null || setUpBusiness == "") {
            $.toast("请输入客户所在地", "text");
            return false;
        }
        var useTime = $("#datetime-picker").val();
        if(useTime == null || useTime == "") {
            $.toast("请选择到访时间", "text");
            return false;
        }
        var customerSource = $("#customerSource").attr("data-values");
        if(customerSource == null || customerSource == "") {
            $.toast("请选择客户来源", "text");
            return false;
        }
        var remarks = $("#remarks").val();
        var moreRemarks = $("#moreRemarks").val();
        $.fn.postMethodResult("/weChat/reportSave",{'itemId':itemId,'customerSource':customerSource,'name':name,'sex':sex,'phone':phone,'useTimeStr':useTime,'remarks':remarks,'memberId':memberId,
            'setUpBusiness':setUpBusiness,'moreRemarks':moreRemarks},function (data) {
            $.alert("提交成功！",function () {
                window.location.reload();
            });
        });
    }
</script>
</html>
